﻿using System;
using System.ComponentModel.DataAnnotations;
using BITC.Web.Library.Base;
using VVA.Data.Resource;
using System.Web.Mvc;

namespace VVA.Data.Entity
{
    public class Article : BusinessObject
    {
        public int ArticleID { get; set; }

        [Required(ErrorMessageResourceName = "Required_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        [Display(Name = "Article_Title", ResourceType = typeof(EntityResource))]
        [StringLength(255, ErrorMessageResourceName = "StringLength_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        public string Title { get; set; }

        [StringLength(50, ErrorMessageResourceName = "StringLength_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        [Display(Name = "Slug", ResourceType = typeof(EntityResource))]
        [Required(ErrorMessageResourceName = "Required_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        public string Slug { get; set; }

        [Display(Name = "Description", ResourceType = typeof(EntityResource))]
        [StringLength(1000, ErrorMessageResourceName = "StringLength_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        [AllowHtml]
        public string Description { get; set; }

        [Required(ErrorMessageResourceName = "Required_ErrorMessage", ErrorMessageResourceType = typeof(MessageResource))]
        [Display(Name = "Article_Body", ResourceType = typeof(EntityResource))]
        [AllowHtml]
        public string Body { get; set; }

        [Display(Name = "Article_Taxonomy", ResourceType = typeof(EntityResource))]
        public Guid TaxonomyID { get; set; }

        [Display(Name = "Article_Taxonomy", ResourceType = typeof(EntityResource))]
        public string TaxonomyName { get; set; }

        public string TaxonomySlug { get; set; }

        [Display(Name = "Article_Status", ResourceType = typeof(EntityResource))]
        public int Status { get; set; }

        [Display(Name = "Avatar_AllowComment", ResourceType = typeof(EntityResource))]
        public bool AllowComment { get; set; }

        [Display(Name = "Article_Avatar", ResourceType = typeof(EntityResource))]
        public string Avatar { get; set; }

        [Display(Name = "SortOrder", ResourceType = typeof(EntityResource))]
        public int SortOrder { get; set; }
    }
}
